package com.baidu.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SqliteHelper extends SQLiteOpenHelper {
	/** 数据库名称 **/
	public static final String DBNAME = "apple.db";
	/** 数据库版本 **/
	public static final int DBVERSION = 5;

	/** 数据表 ***/
	public static final String history_searchword = "history_searchword";
	/** 创建历史搜索词数据表 **/
	private String create_history_searchword = "create table history_searchword(_id integer primary key autoincrement,searchWord text)";

	public SqliteHelper(Context context) {
		super(context, DBNAME, null, DBVERSION);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(create_history_searchword);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		db.execSQL("drop table if exists " + history_searchword);
		onCreate(db);
	}

}
